//
//  MajTextFieldFormatter.m
//  Cabinet
//
//  Created by Florent Montsegur on 09/05/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "MajTextFieldFormatter.h"


@implementation MajTextFieldFormatter

- (id)init
{
    self = [super init];
    if (self) {
        // Initialization code here.
    }
    
    return self;
}


- (NSString *)stringForObjectValue:(id)object { 
    return (NSString *)object; 
} 
- (BOOL)getObjectValue:(id *)object forString:(NSString *)string errorDescription:(NSString **)error { 
    *object = string; 
    return YES; 
} 
- (BOOL)isPartialStringValid:(NSString *)partialString newEditingString:(NSString **)newString errorDescription:(NSString **)error { 
    
    *newString = [partialString uppercaseString]; 
    return [*newString isEqual:partialString]; 
} 
- (NSAttributedString *)attributedStringForObjectValue:(id)anObject withDefaultAttributes:(NSDictionary *)attributes { 
    return nil; 
} 

@end
